The present invention relates to time constraints in communication protocols of the application layer used in entities of the smart card type, also referred to as an integrated circuit card or microprocessor card. It relates particularly to communication protocols where time measurement constraints are severe, for example for communication protocols dedicated to cards with or without contacts, and difficult to take into account, for example for open operating systems.
The majority of smart cards, such as a credit card or a SIM (Subscriber Identity Module) telephone subscriber card, exchange, with terminals, such as readers or mobile radiotelephone stations, to which the cards are electrically connected during operation, data according to dedicated communication protocols according to ISO standard 7816-3.
According to this standard, during a process of exchanging data blocks (I-blocks) according to the T=1 asynchronous block transmission protocol at application layer level, the time between the leading edge of the last character of a first block received by the card and the leading edge of the first character of a second data block transmitted by the card may not exceed a predetermined maximum time BWT (Block Waiting Time). If, during the sequence of operations of the application process, the application layer of the card knows that the processing of the first block will exceed the predetermined maximum time and it must therefore put the terminal into a “wait state”, the application layer transmits a specific protocol request referred to as “Waiting Time eXtension” WTX before expiry of the maximum time BWT. The information field of the WTX request contains an integer multiple of the maximum time BWT, defining a time allocated to the application layer of the card which starts after the reception of an acknowledgement transmitted by the terminal in response to the request.
If, following a first block, the card does not send another block normally before expiry of the time BWT, or on request, before expiry of the allocated time, the terminal interprets this absence of a block as a time-out and for example sends the first block again.
However, at application level, the smart card software programs are first designed independently of any notion of time relating to information exchanges.
On the one hand, the application is not intended to count the time since the performance time-wise is dependent on the operating system, particularly on the characteristics of the microprocessor, the system routines, etc. This problem is very difficult to solve in open operating systems such as JavaCard, where the application, such as an applet, is assumed to be an independent platform.
On the other hand, it is not desirable that the lower level sub-programs (kernel) are responsible for issuing these requests since they are completely disconnected from the time aspects.
Thus, certain communication protocols are very restrictive in terms of time management, since the time values are directly linked to the efficiency of the protocol, for example dedicated contactless card protocols.
Two types of management of waiting time extension WTX requests are known according to the prior art for solving this problem.
In a first type, as shown in FIG. 1, the waiting time extension WTX requests supplied by the protocol layer PR1 underlying the application layer AP1 in the card are managed by the application layer AP1 itself. This software architecture is not portable, that is to say the times are dependent on the sub-programs K1 (kernel), it has an empirical time counting, is not applicable when the application calls a service having a long processing process, for example a complex cryptography algorithm, does not take into account specific parameters such as the durations of waiting times, and is very restrictive for the application during short waiting times, for example those relating to dedicated contactless protocols.
According to a second type, the waiting time extension WTX requests are supplied by the protocol layer PR2 to the sub-programs (kernel) K2 which manage them, as shown in FIG. 2. This second known software architecture is advantageous in that the application is relieved of the management of the WTX requests which is a requirement in open operating systems since the functions of the application are independent of the functions of applications with at least one external entity. Furthermore, the software architecture facilitates the implementation of a long process by inserting a number of calls with WTX requests during the process.
However, this second software architecture is neither rigorous nor exhaustive owing to the difficulties to be considered each call sequence by sub-programs, does not taken into account specific protocol parameters, such as waiting times, and may have repercussions on each sub-program.